<template>
	<view class="content">
		
		
		
		<view class="list">
			<!-- <view class="line list-title item-flex">
				<view>试喝人</view>
				<view>数量</view>
				<view>日期</view>
				<view>备注</view>
			</view> -->
			<view class="line" v-for="(item,index) in blance">
				
					<view class="line_list">
						<text>数量</text>
						<view>{{item.number}}
						</view>
					</view>
					
					<view class="line_list">
						<text>时间</text>
						<view>
						{{item.time}}
						</view>
					</view>
					
					<view class="line_list">
						<text>状态</text>
						<view>
						{{item.states_name}}
						</view>
					</view>
					<view class="line_list" v-if="item.states!=0">
						<text>快递单号</text>
						<view>
						{{item.shopnumber}}
						</view>
					</view>
					<view class="line_list"  v-if="item.states!=0">
						<text>快递公司</text>
						<view>
						{{item.shopname}}
						</view>
					</view>
					<view class="line_list">
						<text>操作</text>
						<view  v-if="item.states==0" @click="fahuo">
						提醒发货
						</view>
						<view  v-if="item.states==1" @click="shouhuo(item.try_order_id)" style="text-align: center;background: red;border-radius: 8upx;height: 50upx;line-height: 50upx;width: 40%;margin-top: 8upx;">
						确认收货
						</view>
					</view>
					
					
					
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				startDate:"2021-09",
				endDate:"2021-10",
				date:"2021-10",
				seePoup:false,
				blance:[],
				userinfo:'',
				number:'',
				seePoups:false,
				uid:''
			}
		},
		onLoad() {
		
		uni.getStorage({
						 key: 'userInfo',
						success: (res) => {
						console.log(res, "00000");
							this.userinfo = res.data;
							// uni.setStorage({
							// 	key: 'userinfo',
							// 	data: this.userinfo
							// });
							//console.log(this.userinfo, '用户信息')
							if (this.userinfo == '') {
							//	console.log(res, "00000");
								// uni.navigateTo({
								// 	url: `/pages/login/login`
								// })
							}
							//this.getUserLists()
						},
						fail: (res) => {
							//console.log(res,'sssss')
							// uni.navigateTo({
							// 	url: `/pages/public/login`
							// })
						}
					});
					this.getuserblance()
					
		},
		methods: {
			fahuo(){
				uni.showToast({
					title:'提醒成功',
					icon:'none'
				})
			},
			
		changenumber(e){
			
			this.number=e.detail.value
			//console.log(e)
			
		},
		uidsss(e){
			this.uid=e.detail.value
		},
		async shouhuo(e){
			
			const res=await this.$myRequest({
					url:'index.php/api/user/try_ordershouhuo',
					method:"POST",
					data:{
						"try_order_id":e,
						'member_id':this.userinfo.member_id
					},
					
				
			})	
			if(res.status==200){
			uni.showToast({
				title:res.data,
				icon:'none'
			})
			}
		},
		async getuserblance(){
			//console.log(this.userinfo,'aaaaaaaaaa')
					const res=await    this.$myRequest({
					url:'index.php/api/user/try_orderlog',
					method:"POST",
					data:{
						"member_id":this.userinfo.member_id
					},
					
				
			})	
			this.blance=res.data
		}
		
		},
		onShow() {
			const res=  uni.getStorage({
			    key: 'userInfo',
			    success: (res)=> {
					
					if(res.data){
						
			     this.userinfo=res.data
				 if(this.userinfo.member_id){
				 //this.getuseragain();
				// this. url="http://pth5.njkw668.com/#/pages/user/user?&pid="+this.userinfo.member_id
				 }
				 }
				 else{
					 window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9a8339b68f86cd01&redirect_uri=http%3A%2F%2Fpth5.njkw668.com%2F%23%2Fpages%2Fpublic%2Flogin&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
				 }
			    },
				fail: (res)=> {
				window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9a8339b68f86cd01&redirect_uri=http%3A%2F%2Fpth5.njkw668.com%2F%23%2Fpages%2Fpublic%2Flogin&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
				}
			});
		},
		
		
		
	}
</script>

<style>
	
	.flex-center{
	
		width: 25%;
		float: left;
	}
	.flex-around{
		justify-content:space-around;
	}
	page{
		background: #f5f5f5;
	}
	.topBox{
		
		font-size: 32rpx;
		color: black;
		height:320rpx;
		background:url(../../static/user-bg.jpg);
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		align-items: center;
	}
	.topBox button{
		font-size: 32rpx;
		width: 30%;
		background: red;
		color: black;
		
	}
	.moneyTxt{
		font-size: 40rpx;
		color: red;
		font-weight: bold;
	}
	.top-line{
		width: 94%;
		flex: 1;
		padding: 10rpx 3%;
		height: 72rpx;
		line-height: 72rpx;
	}
	.list{
		width: 100%;
		margin-top: 10upx;
		border-radius: 10upx;
		
		
	}
	.list .line:last-child{
		border:none
	}
	.line{
		width: 96%;
		flex: 1;
		
		line-height: 66rpx;
		
		margin: 0 auto;
		border-bottom: 10upx solid #DCDFE6;
		overflow: hidden;
	}
	.line_list{
		width: 50%;
		float: left;
		background: white;
		border-bottom: 1px solid #D6D6D6;
		
	}
	.line_list text{
		width: 40%;
		float: left;
		padding-left: 3%;
		text-align: center;
		font-size: 26upx;
	}
	.line_list view{
		width: 57%;
		float: left;
		
	
		font-size: 28upx;
	}
	.line image{
		width: 48rpx;
		border-radius: 50%;
		margin-right: 10rpx;
	}
	.changeMonth{
		width: 30%;
		margin-right: 10%;
		position: relative;
	}
	.changeMonth picker{
		width: 100%;
	}
	.changeMonth image{
		width: 32rpx;
		position: absolute;
		right: 0;
		top: 20rpx;
	}
	.changeIcon{
		width: 32rpx;
	}
	.sumTxt{
		width: 60%;
		font-size: 28rpx;
		color: #999;
	}
	
	.marke{
		width: 100%;
		height: 100%;
		position: fixed;
		top:0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 990;
		background: rgba(0,0,0,0.7);
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.withdraw{
		width: 80%;
		background: #fff;
		border-radius: 20rpx;
		position: relative;
	}
	.markeTitle{
		width: 100%;
		height: 88rpx;
		line-height: 88rpx;
		font-size: 32rpx;
		color: #333;
		text-align: center;
		background: #f5f5f5;
		border-radius: 20rpx 20rpx 0 0;
	}
	.moneyBox{
		width: 90%;
		height: 100rpx;
		line-height: 100rpx;
		border-bottom: 2rpx solid red;
		margin: 20rpx 5%;
		text-align: center;
		font-size: 42rpx;
		font-weight: bold;
		color: red;
	}
	.tips{
		font-size: 30rpx;
		color: #bebebe;
		text-align: center;
		font-weight: normal;
	}
	.withdraw button{
		width: 90%;
		margin: 20rpx 5%;
		margin-top: 40rpx;
		font-size: 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		border: none;
		background: #007AFF;
		color: #fff;
	}
	.withdraw button::after{
		border: none;
	}
	.cancel{
		position: absolute;
		top: -20rpx;
		right: -20rpx;
		background: #fff;
		border-radius: 50%;
		z-index: 999;
		
	}
</style>
